﻿<style type="text/css">
    body{background: #f2f2f2}
    .mv-charge{width: 80%;margin: 0 auto;background: #fff;margin-top:20px;}
    .mv-charge .charge-mid{padding-top: 15px;padding-bottom: 15px;}
    .mv-charge .charge-mid img{display:block;max-width: 100%;margin: 0 auto;width:75%;}
    .mv-charge .charge-contetent{text-align: center;padding-bottom: 15px;}
    .mv-charge .charge-contetent p{color:#fb5120;font-size: 16px; }
    .mv-charge .charge-contetent input{background: #f2f2f2;border: none;width:90%;text-align: center;padding:10px 3px;margin-top: 10px;}
    .mv-charge .charge-contetent a{display: inline-block;padding: 5px 20px;color:#fff;background: #7583b6;margin-top: 15px;border-radius: 5px;}
</style>
<div class="mv-charge">
    <div class="charge-mid">
        <img :src="bag.qrcode">
    </div>
    <div class="charge-contetent">
        <p>充币地址</p>
        <input type="text" id="address" :value="bag.address">
        <a v-on:click="copy">复制地址</a>
    </div>
</div>
<div style="height:60px;"></div>
<script type="text/javascript">
    var pagedata = {
        request: {
            method: "VIEW_STOCK_DEPOSIT",
            type: mview.view.chlid.param.id
        },
        screen: {
            header_display: true,
            header_title_name: "充币",
            header_exit_name: "返回",
            header_exit_click: function () {
                mview.view.back();
            },
            footer_display: true,
            footer_choose: "user"
        },
        data: {
            
        },
        methods: {
            copy: function () {
                var copyDom = document.querySelector('#address')
                var range = document.createRange();
                range.selectNode(copyDom);
                window.getSelection().removeAllRanges();
                window.getSelection().addRange(range);
                var successful = document.execCommand('copy');
                if (successful) {
                    mview.control.tips("已复制到剪切板");
                }
                else {
                    mview.control.tips("复制失败");
                }
            }
        }
    }
    mview.view.chlid.init(pagedata);
</script>